import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import piniaStore from './store';
// import '@/router/permission';
import '@/assets/styles/index.less';
import SvgIcon from '@/components/SvgIcon/index.vue';
// 支持SVG
import 'virtual:svg-icons-register';
import 'leaflet/dist/leaflet.css';
import * as L from 'leaflet';

import 'ant-design-vue/dist/antd.less';
//国际化
import 'leaflet.pm';
import 'leaflet.pm/dist/leaflet.pm.css';

import iconRetinaUrl from 'leaflet/dist/images/marker-icon-2x.png';
import iconUrl from 'leaflet/dist/images/marker-icon.png';
import shadowUrl from 'leaflet/dist/images/marker-shadow.png';

delete L.Icon.Default.prototype._getIconUrl;
L.Icon.Default.mergeOptions({
  iconRetinaUrl,
  iconUrl,
  shadowUrl,
  iconSize: [25, 41],
  iconAnchor: [12, 41],
  popupAnchor: [1, -34],
  tooltipAnchor: [0, 0],
  shadowSize: [41, 41],
});

//国际化
import i18n from './locales';

const app = createApp(App);
app.component('SvgIcon', SvgIcon);
app.use(piniaStore);
app.use(router);
app.use(i18n);
app.mount('#app');
app.provide('$L', L);
// app.config.globalProperties.$L = L;
